package com.csd.action.team;

import java.util.List;

import com.csd.helper.ActionResult;
import com.csd.pojo.ProjectType;
import com.csd.pojo.ResearchField;
import com.csd.pojo.Teacher;
import com.csd.service.IProjectService;
import com.csd.service.IProjectTypeService;
import com.csd.service.IResearchFieldService;
import com.csd.service.ITeacherService;
import com.csd.serviceImpl.ProjectService;
import com.csd.vo.UserVO;
import com.opensymphony.xwork2.Action;

/**
 * 
 * Action:申请前，查询所有的老师、研究领域
 * 
 * @author csd
 * @version 1.0
 * 
 * <br>
 *          修订时间：2009-12-17 <br>
 *          修改原因：创建文件 <br>
 *          修改人：刘世彬
 * 
 * <br>
 * 
 */
public class ProjectInApplyAction
{

	/** 查询到的项目类型列表 */
	private List<ResearchField> listOfResearchField;

	private List<UserVO> listOfTeacher;

	private String projectTypeID;

	public String getProjectTypeID() {
		return projectTypeID;
	}

	public void setProjectTypeID(String projectTypeID) {
		this.projectTypeID = projectTypeID;
	}

	private IResearchFieldService researchFieldService;

	private ITeacherService teacherService;

	public List<ResearchField> getListOfResearchField() {
		return listOfResearchField;
	}

	public void setListOfResearchField(List<ResearchField> listOfResearchField) {
		this.listOfResearchField = listOfResearchField;
	}

	public List<UserVO> getListOfTeacher() {
		return listOfTeacher;
	}

	public void setListOfTeacher(List<UserVO> listOfTeacher) {
		this.listOfTeacher = listOfTeacher;
	}

	public IResearchFieldService getResearchFieldService() {
		return researchFieldService;
	}

	public void setResearchFieldService(
			IResearchFieldService researchFieldService) {
		this.researchFieldService = researchFieldService;
	}

	public ITeacherService getTeacherService() {
		return teacherService;
	}

	public void setTeacherService(ITeacherService teacherService) {
		this.teacherService = teacherService;
	}

	public String execute() 
	{
		String result = ActionResult.fail;

		this.listOfResearchField = researchFieldService.listAllResearchField();
		this.listOfTeacher = teacherService.listAllTeacher();
		
		if (this.listOfResearchField != null && this.listOfTeacher != null) 
		{
			result = ActionResult.success;
		}

		return result;
	}
}
